using System;
using System.Collections.Generic;
using System.Text;
using Xyne.Templates.PuzzlePieceTemplate;
using Xyne.Objects;

namespace Xyne.Utilities
{
    public class PatternGenerator
    {
        private static Random random;

        public static PatternValue[,] GeneratePattern(int x, int y)
        {
            PatternValue[,] pattern = new PatternValue[x, y];
            if (random == null)
            {
                random = new Random(DateTime.Now.Millisecond);
            }
            for (int xIndex = 0; xIndex < x; xIndex++)
            {
                for (int yIndex = 0; yIndex < y; yIndex++)
                {
                    pattern[xIndex, yIndex] = new PatternValue((PatternValueEnum)random.Next(PatternValue.NumberOfValues));
                }
            }

            return pattern;
        }      
    }
}
